﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using University;
using System;

namespace UniversityTests
{
    [TestClass]
    public class StudentTest
    {
        [TestMethod]
        public void ConstructorNormal()
        {
            Student target = new Student("Abc", 12345);
            Assert.IsNotNull(target);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void ConstructorEmptyName()
        {
            Student target = new Student("", 12345);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void ConstructorNullName()
        {
            Student target = new Student(null,12345);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void ConstructorSmallFacultyNumber()
        {
            Student target = new Student("abc", 0);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void ConstructorBigFacultyNumber()
        {
            Student target = new Student("abc", 100000);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void ConstructorNegativeFacultyNumber()
        {
            Student target = new Student("abc", -3);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void ConstructDuplicateStudents()
        {
            Student first = new Student("abc", 10000);
            Student second = new Student("def", 10000);
        }
    }
}
